package com.aiyige.model.request;

import com.aiyige.base.api.ApiManager;

import okhttp3.ResponseBody;
import retrofit2.Call;

/**
 * Created by zhuyakun on 2017/11/1.
 */

public class UpdateUserInfoRequest {
    String avatar;
    String nickName;
    Integer sex;
    Long birthday;
    String introduce;
    String city;
    Integer countryId;

    private UpdateUserInfoRequest(Builder builder) {
        setAvatar(builder.avatar);
        setNickName(builder.nickName);
        setSex(builder.sex);
        setBirthday(builder.birthday);
        setIntroduce(builder.introduce);
        setCity(builder.city);
        setCountryId(builder.countryId);
    }

    public static Builder newBuilder() {
        return new Builder();
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public Long getBirthday() {
        return birthday;
    }

    public void setBirthday(Long birthday) {
        this.birthday = birthday;
    }

    public String getIntroduce() {
        return introduce;
    }

    public void setIntroduce(String introduce) {
        this.introduce = introduce;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public Integer getCountryId() {
        return countryId;
    }

    public void setCountryId(Integer countryId) {
        this.countryId = countryId;
    }

    public static final class Builder {
        private String avatar;
        private String nickName;
        private Integer sex;
        private Long birthday;
        private String introduce;
        private String city;
        private Integer countryId;

        private Builder() {
            avatar = null;
            nickName = null;
            sex = null;
            birthday = null;
            introduce = null;
            city = null;
            countryId = null;
        }

        public Builder avatar(String avatar) {
            this.avatar = avatar;
            return this;
        }

        public Builder nickName(String nickName) {
            this.nickName = nickName;
            return this;
        }

        public Builder sex(Integer sex) {
            this.sex = sex;
            return this;
        }

        public Builder birthday(Long birthday) {
            this.birthday = birthday;
            return this;
        }

        public Builder introduce(String introduce) {
            this.introduce = introduce;
            return this;
        }

        public Builder city(String city) {
            this.city = city;
            return this;
        }

        public Builder countryId(Integer countryId) {
            this.countryId = countryId;
            return this;
        }

        public Call<ResponseBody> build() {
            return ApiManager.getService().updateUserInfo(new UpdateUserInfoRequest(this));
        }
    }
}
